package com.settlement.system.service.impl;

import com.settlement.system.mapper.TblWpBillDiscountDetailMapper;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.TblWpBillDiscountDetail;
import com.settlement.system.service.ITblWpBillDiscountDetailService;
import org.springframework.stereotype.Service;
import com.settlement.system.mapper.BaseMapper;
import jakarta.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 唯品会账单折扣明细 服务实现类
 * @author Ximi
 * @since 2020-04-17
 */
@Service
public class TblWpBillDiscountDetailServiceImpl extends BaseServiceImpl implements ITblWpBillDiscountDetailService {

    @Resource
    private TblWpBillDiscountDetailMapper tblWpBillDiscountDetailMapper;

    @Override
    public BaseMapper init() {
        return tblWpBillDiscountDetailMapper;
    }

    /**
     * 获取合计
     * @param params
     * @return
     * @throws ServiceException
     */
    @Override
    public TblWpBillDiscountDetail selectFoot(Map<String, Object> params) throws ServiceException {
        try {
            return tblWpBillDiscountDetailMapper.selectFoot(params);
        } catch (Exception ex){
            throw  new ServiceException("唯品会账单折扣明细合计异常",ex);
        }
    }

    /**
     * 查询 列表中 非【衣酷】 的数据有多少条
     * @param idList
     * @return
     * @throws ServiceException
     */
    @Override
    public int selectCountNotYk(List<String> idList, String toBeDeletedScheduleId) throws ServiceException {
        try {
            return tblWpBillDiscountDetailMapper.selectCountNotYk(idList,toBeDeletedScheduleId);
        } catch (Exception e) {
            throw new ServiceException(e);
        }
    }

}

